module CanCamelFilters
  module_function

  include CanCamel::Validators
  include CanCamel::Filter

  validates :with_user_scope,
            :scope,
            presence: {},
            custom: { lambda: -> (x) { User.respond_to? x.to_sym } }
  register_filter :with_user_scope, -> (scope:, **_) { { user_scope: User.send(scope.to_sym) } }

  validates :with_user_scope2,
            :scope,
            custom: {
              lambda: -> (x) { User.respond_to? x.to_sym },
              empty: true,
            }
  register_filter :with_user_scope2, -> (scope: :all, **_) { { user_scope: User.send(scope.to_sym) } }

  register_filter :unvalidated_filter, -> (**_) { {} }
end
